package net.bbtang.website.log;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.net.SyslogAppender;

public class CustomerLog {
	/** 
     * 继承Level 
     * @author zx
     * 
     */  
    private static class CustomerLogLevel extends Level{  
        /**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public CustomerLogLevel(int level, String levelStr, int syslogEquivalent) {  
            super(level, levelStr, syslogEquivalent);  
        }         
    }  
      
    /** 
     * 自定义级别名称，以及级别范围 
     */  
    private static final Level CustomerLevel = new CustomerLogLevel(20050,"CUSTOMER",SyslogAppender.LOG_LOCAL0);  
      
    /** 
     * 使用日志打印logger中的log方法 
     *  
     * @param logger 
     * @param objLogInfo 
     */  
    public static void customerLog(Logger logger,String objLogInfo){  
        logger.log(CustomerLevel, objLogInfo);  
    }
    
    /**
     * 打印行为日志
     * @param logger
     * @param activer 主动方标记
     * @param action 动作
     * @param passiver 被动方标记
     */
    public static void customerLog(Logger logger,String activer,String action,String passiver){
    	 logger.log(CustomerLevel,"activer:"+activer+",action:"+action+",passiver:"+passiver);  
    }

}
